#include "movie_socket.h"
#include <iostream>

MovieSocket::MovieSocket(QString fileName) :
        file(fileName)
{  
}

qint64 MovieSocket::readData(char *data, qint64 maxlen)
{
    std::cout << "reading data" << std::endl;
    return file.read(data,maxlen);
}

bool MovieSocket::isSequential() const
{
    return false;
}

bool MovieSocket::open(QIODevice::OpenMode mode)
{
    this->QIODevice::open(mode);
    bool res = file.open(mode);
    std::cout << "res: " << res << std::endl;
    return res;
}

bool MovieSocket::seek(qint64 pos)
{
    std::cout << "in seek" << std::endl;
    this->QIODevice::seek(pos);
    return file.seek(pos);
}

qint64 MovieSocket::size() const
{
    std::cout << "in size" << std::endl;
    return file.size();
}


qint64 MovieSocket::writeData(const char *data, qint64 len)
{
    return 0;
}
